package com.yugao.fintech.antelope.mps.api.constatnts;

import com.yugao.fintech.antelope.mps.api.MsgPushApi;
import com.yugao.fintech.antelope.mps.api.handler.IMsgPushAsyncHandler;
import com.yugao.fintech.antelope.mps.api.handler.MsgPushToMqHandler;
import com.yugao.fintech.framework.assistant.utils.StringUtils;
import com.yugao.fintech.framework.assistant.utils.exception.BizException;
import com.yugao.fintech.framework.core.utils.SpringUtils;


public class StaticService {

    public static MsgPushApi msgPushApi() {
        return SpringUtils.getBean(MsgPushApi.class);
    }

    public static IMsgPushAsyncHandler msgPushAsyncHandler() {
        if (!SpringUtils.containsBean(StringUtils.uncapitalize(MsgPushToMqHandler.class.getSimpleName()))) {
            throw new BizException("请配置mq并引入相关mq依赖");
        }
        return SpringUtils.getBean(IMsgPushAsyncHandler.class);
    }
}
